<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<script type="text/javascript" src=""></script>
	<script type="text/javascript" src=""></script>
	<script type="text/html" id="weather">
		{{if weather}}
		     {{each weather as value}}
		      <div>
		          <span>日期:{{value}}</span>
		          <ul>
		              <li>白天天气{{value.info.day[1]}}</li>
		              <li>白天温度{{value.info.day[2]}}</li>
		              <li>白天风向{{value.info.day[3]}}</li>
		              <li>白天风速{{value.info.day[4]}}</li>
		          </ul>
		          <ul>
		              <li>夜间天气{{value.info.night[1]}}</li>
		              <li>夜间温度{{value.info.night[2]}}</li>
		              <li>夜间风向{{value.info.night[3]}}</li>
		              <li>夜间风速{{value.info.night[4]}}</li>
		          </ul>
		      </div>
		      {{/each}}
		{{/if}}
	</script>
	<script type="text/javascript" src="">
		$(function(){
			$("#query").click(function(){
				var code =$('#city').val();
				$.ajax({
					url:'http://cdn.weather.hao.360.cn/api_weather_info.php',
					data:{app:'hao360',code:code},
					jsonp:'_jsonp',
					jsonpCallback:'abc',
					dataType:'jsonp',
					success:function(data){
//						一堆版
						var w =data.weather;
						var tag='';
						$.each(w,function(i,e){
							var date=e.date;
							var day=e.info.day;
							var night =e.info.night;
							
							tag+='<div>'+
							   '<span>日期：'+date+'</span>'+
							   '<ul>'+
							        '<li>白天天气'+day[1]+'</li>'+
							        '<li>白天温度'+day[2]+'</li>'+
							        '<li>白天风向'+day[3]+'</li>'+
							        '<li>白天风速'+day[4]+'</li>'+
							    '</ul>'+
							    '<ul>'+
							        '<li>夜间天气'+night[1]+'</li>'+
							        '<li>夜间温度'+night[2]+'</li>'+
							        '<li>夜间风向'+night[3]+'</li>'+
							        '<li>夜间风速'+night[4]+'</li>'+
							    '</ul>'+
							    '</div>'    
						});
						$('#info').html(tag);
					}
				})
			})
		})
	</script>
	<body>
		<div id="container">
			<select id="city">
				<option value="101010100">北京</option>
				<option value="101020100">上海</option>
				<option value="101280101">广州</option>
				<option value="101280601">深圳</option>
			</select>
			<input type="button" id="query" value="查询" />
			<div id="info"></div>
		</div>
	</body>
</html>
